

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'student.label', default: 'Student')}" />
        <title><g:message code="default.list.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="body">
            <h1><g:message code="default.list.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
            <span class="search">
      
             
             移动至<g:select name="classes"
          from="${Classes.findAllBySchool(session.school)}"
          value="${classes?.id}"
          optionKey="id" 
          noSelection="['':'-选择班级-']"/> 
          <g:hiddenField name="selectStudentList" value="" />
          <g:hiddenField name="oldClassesid" value="" />
          <button id="submitStudents">提交</button>
           </span>

            <span class="search">
              <g:form action="studentSearchList" controller="studentMgr" method="post" name="studentSearch">
                   姓名 <input style="width:10%" type="text" id="name" name="name" maxlength="50" value="${name}"/>
                   性别 <g:select name="sex" from="${['男','女']}" noSelection="['':'所有']" value="${sex}"/>
                   班级 <g:select name="classesid" from="${Classes.findAllBySchool(session.school)}" optionKey="id" value="${classes}"  noSelection="['':'请选择班级']"/>
                   职务 <g:select name="level" from="${studentLevels}" optionKey="code" optionValue="value"  noSelection="['':'所有']"  value="${level}"/>
                   <g:hiddenField name="isSearch" value="true" />
                   <input type="submit" value="${message(code: 'student.search.label', default: 'Search')}">
              </g:form>
            </span>
         </div>
            <div class="list">
                <table>
                    <tr><td><g:checkBox name="selectAll" class="checkbox" alt="全选/不选本页学员"/>全选</td></tr>
                    <thead>
                        <tr>
                            <th>选择</th>
                            <g:sortableColumn property="name" title="${message(code: 'student.name.label', default: 'Name')}" />
                        
                            <g:sortableColumn property="sex" title="${message(code: 'student.sex.label', default: 'Sex')}" />                            

                            <g:sortableColumn property="birthday" title="${message(code: 'student.birthday.label', default: 'Birthday')}" />

                            <th>${message(code: 'classes.label', default: '班级')}</th>
                            
                            <!--<g:sortableColumn property="enable" title="${message(code: 'teacher.enable.label', default: 'Enable')}" />-->

                            <g:sortableColumn property="enable" title="${message(code: 'teacher.state.label', default: 'State')}" />
                            
                            <th></th>
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${studentInstanceList}" status="i" var="studentInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                            <td><g:checkBox class="checkbox" name="selectStudent" value="${studentInstance.id}"  checked="false"/></td>     
                            <td><g:link controller="studentMgr" action="show" id="${studentInstance.id}">${fieldValue(bean: studentInstance, field: "name")}</g:link></td>
                        
                            <td>${fieldValue(bean: studentInstance, field: "sex")}</td>
                        
                            <td><g:formatDate date="${studentInstance.birthday}" /></td>

                            <td>${studentInstance?.classes?.encodeAsHTML()}</td>
                        <!--
                            <td><g:formatBoolean boolean="${studentInstance.enabled}" />
                            <g:link controller="studentMgr" action="goswitch" id="${studentInstance.id}">${studentInstance.enabled?"开启":"关闭"}
                            </g:link>
                            </td>
                        -->
                            <td>${studentInstance.state?"离校":"在校"}</td>

                            <td>
                           <g:link controller="studentEvaluateMgr" action="list" id="${studentInstance.id}">查看评价</g:link>
                            </td>
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <x:paginate total="${studentInstanceTotal}" />
            </div>
        </div>
        <g:javascript src="domain/student_list.js" type="text/javascript"/>
        <g:javascript src="domain/classesMgr_student.js" type="text/javascript"/>
    </body>
</html>
